//
//  YHRouterParam.m
//  YHRouter
//
//  Created by 98du on 2021/12/1.
//

#import "YHRouterParam.h"

@implementation YHRouterParam

+(instancetype)params:(id)passParams, ...NS_REQUIRES_NIL_TERMINATION{
    YHRouterParam * routerParam = [YHRouterParam new];
    {
        NSInteger index = 1;
        va_list args;
        va_start(args, passParams);
        for (id currentObject = passParams; currentObject != nil; currentObject = va_arg(args, id)) {
            [routerParam setValue:currentObject forKey:[NSString stringWithFormat:@"arg%zd",index]];
            index = index + 1;
        }
        va_end(args);
    }
    return routerParam;
}

@end
